<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ include file="/taglibs.jsp"%>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath()%>'/>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.alphanumeric.js"></script>
<s:url value="/images" var="imgPath"/>
<link rel="stylesheet" type="text/css" href="/css/smoothness.datepick.css" />
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick-zh-CN.js"></script>
<link rel="stylesheet" href="/css/jquery.tooltip.css" />
<script src="/js/jquery.tooltip.min.js" type="text/javascript"></script>
<script language="javascript">
	$().ready(function(){
		$("tr[id*='tdDesc_']").tooltip();
		$("#createDateParam").datepick({showOn:'both',numberOfMonths:2, buttonImageOnly: true, buttonImage: '${imgPath}/calendar.gif',dateFormat:"yy-mm-dd"});
		$("#productIdParam").numeric();
		$("#searchbtn").click(function(){
			$("#productSearchForm").submit();
		});
	});
</script>
<h1>商品上下架审核-查询</h1>
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<br/>
<div class="data-form">
	<s:form action="searchApprove.do" method="post" id="productSearchForm">
		<b>商品编号：</b>
		<input name="productIdParam" id="productIdParam" type="text" title="商品编号" size="10" value="${productIdParam}" >
	  <b>申请人：</b>
  	<s:select name="createUserParam" list="users" listKey="username"  listValue="nameNative" headerKey="" headerValue="全部"/>
		<b>申请状态：</b>
		<s:select name="statusParam" list="shelfStatusMenu.options" listKey="key"  listValue="value.name"/>
	  <b>申请日期：</b>
  	<input name="createDateParam" id="createDateParam" size="10" maxlength="10" value="${createDateParam}">  	
		<input type="button" id="searchbtn" value="查询"/>	
	</s:form>
</div>
<br/>
<table class="tb-1" width="100%">
	<thead>
		<tr>
			<th>申请日期</th>
			<th>商品编号</th>
			<th width="15%">商品名称</th>
			<th>成本</th>
			<th>售价</th>
			<th>上架日期</th>
			<th>下架日期</th>
			<th>申请人</th>
			<th>审核人</th>
			<th>审核时间</th>
			<th>状态</th>
			<th>处理</th>
		</tr>
	</thead>
	<tbody>
		<c-rt:choose>
			<c-rt:when test="${not empty shelfs}">
				<c-rt:forEach items="${shelfs}" var="shelf" varStatus="index">
					<tr  id="tdDesc_${index.count}" title="建立者:${shelf.createUser} 建立日期:${shelf.createDate}<br/>修改者:${shelf.modifyUser} 修改日期:${shelf.modifyDate}">
						<c-rt:set var="pId" value="${shelf.productId}"/>
						<td><fmt-rt:formatDate value="${shelf.createDate}" pattern="yyyy-MM-dd"/></td>
						<td>${pId}</td>
						<td>${productMap[pId].productName}</td>
						<td><fmt-rt:formatNumber value="${productMap[pId].productCost}" pattern="######.00"/></td>
						<td><fmt-rt:formatNumber value="${shelf.shelfPrice}" pattern="######.0#"/></td>
						<td><fmt-rt:formatDate value="${shelf.startDate}" pattern="yyyy-MM-dd HH:mm"/></td>
						<td><fmt-rt:formatDate value="${shelf.endDate}" pattern="yyyy-MM-dd HH:mm"/></td>
						<td>${shelf.createUser}</td>
						<td>${shelf.approveUser}</td>
						<td><fmt-rt:formatDate value="${shelf.approveDate}" pattern="yyyy-MM-dd"/></td>
						<td>${shelfStatusMenu.options[shelf.shelfStatus].name}</td>
						<td>
							<a href="${midContextPath}/shelf2/view.do?shelfId=${shelf.shelfId}">查询</a><br/>
							<c-rt:if test="${shelf.shelfStatus eq 'SHF000'}">
								<yaodian100:checkPermission permissions="ROLE_PM_MANAGER,MANAGER_A-20-200-100">
									<a href="${midContextPath}/shelf2/edit.do?shelfId=${shelf.shelfId}&productId=${shelf.productId}&approve=Y">审核</a>
								</yaodian100:checkPermission>
							</c-rt:if>
						</td>
					</tr>
				</c-rt:forEach>
			</c-rt:when>
			<c-rt:otherwise>
				<tr>
					<td colspan="12">查无商品资料</td>
				</tr>
			</c-rt:otherwise>
		</c-rt:choose>
	</tbody>
</table>
<yaodian100:pageutil link="searchApprove.do" pagerObj="${pager}" />